package solution1;

import java.util.Scanner;

/**
 * 输入:
 * 数组长度n
 * n个整数
 * 目标数
 * 例如：
 * 4
 * 1 2 3 4
 * 6
 * 输出：
 * 1 3
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solution s1 = new Solution();
//      System.out.println("请输入数组长度n：");
        while (sc.hasNext()) {
            int n = sc.nextInt();
//            System.out.println("请输入" + n + "个整数：");
            int[] nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = sc.nextInt();
            }
//            System.out.println("请输入target：");
            int target = sc.nextInt();
            int[] result = new int[2];
            result = s1.twoSum(nums, target);
            System.out.println(result[0] + " " + result[1]);
//            System.out.println("请输入数组长度n：");
        }
    }
}
